'use strict'
//创建koa,bodyparser模板
let koa = require('koa');
//let bodyparser = require('koa-bodyparser');
let server = require('koa-static');

// 初始化一个服务器实例
let app = new koa();

//let temp = require('./controllers');
let temp2 = require('./templating');

//app.use(bodyparser());
//app.use(temp());
app.use(temp2);

app.use(server(__dirname));

app.use(async(ctx,next)=>{
    ctx.render("show.html");
});

// 定义端口，设置监听
app.listen(4005);

// 打印服务器信息
console.log("http://127.0.0.1:4005");
